package com.nine.dao;

import java.util.List;


import org.apache.ibatis.annotations.Param;
import com.nine.entity.Product;
import com.nine.entity.ProductCondition;

public interface ProductMapper {
	
	/**
	 * 查询所有商品信息
	 * @return 商品实体集合
	 */
	List<Product> getAllProduct();

	/**
	 * 查询所有商品信息（分页）
	 * @param pageSize 每页显示的记录数
	 * @param pageStart 起始位置
	 * @return 商品实体集合
	 */
	List<Product> getAllProductByPaging(@Param("pageSize") int pageSize,@Param("pageStart") int pageStart);
	
	/**
	 * 查询所有商品信息的记录数
	 * @return 商品信息的记录数
	 */
	Integer getProductCount();
	
	/**
	 * 通过条件查询商品信息（支持模糊查询）
	 * @param condition 条件实体
	 * @return 商品实体集合
	 */
	List<Product> getProductByCondition(ProductCondition condition);
	
	/**
	 * 删除商品信息
	 * 支持单条删除和多条删除
	 * @param pids 商品编号数组
	 * @return 影响行数
	 */
	int deleteMoreProduct(String[] pids);
	
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table product
     *
     * @mbggenerated Thu Sep 13 20:05:52 CST 2018
     */
    int deleteByPrimaryKey(String pid);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table product
     *
     * @mbggenerated Thu Sep 13 20:05:52 CST 2018
     */
    int insert(Product record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table product
     *
     * @mbggenerated Thu Sep 13 20:05:52 CST 2018
     */
    int insertSelective(Product record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table product
     *
     * @mbggenerated Thu Sep 13 20:05:52 CST 2018
     */
    Product selectByPrimaryKey(String pid);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table product
     *
     * @mbggenerated Thu Sep 13 20:05:52 CST 2018
     */
    int updateByPrimaryKeySelective(Product record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table product
     *
     * @mbggenerated Thu Sep 13 20:05:52 CST 2018
     */
    int updateByPrimaryKey(Product record);
    /**
     * 根据条件模糊查询所需要的商品
     * @param product1
     * @return
     */
    public List<Product> getSomethingProduct(Product product1);
}